package com.api.apiclientsdk.utils;


import cn.hutool.crypto.digest.DigestAlgorithm;
import cn.hutool.crypto.digest.Digester;

/**
 * 签名工具
 *
 * @author <a href="https://github.com/licui">程序员鱼皮</a>
 * @from <a href="https://cui.icu">编程导航知识星球</a>
 */
public class SignUtils {
    /**
     * 生成签名
     * @param body
     * @param secretKey
     * @return
     */
    public static String genSign(String body, String secretKey) {
        Digester md5 = new Digester(DigestAlgorithm.SHA256);
        String content = body + "." + secretKey;

        return md5.digestHex(content);
    }

    public static void main(String[] args) {
        String s = genSign("123", "123456");
        System.out.println(s);

    }
}
